#ifndef MEMORYGAME_H
#define MEMORYGAME_H

#include <QPushButton>

#include <QPalette>
#include <QColor>

#include <QSignalMapper>

#include <QTimer>

#include "games/basegame.h"

// MemoryGame: choose pairs of buttons with same color
class MemoryGame : public BaseGame
{
    Q_OBJECT
public:
    // Constructor
    explicit MemoryGame(QWidget *parent = 0, int difflvl = 1);

    // Members
    bool isSolved();
    QString hint() { return "You'll need a strong memory."; }

public slots:
    // Slots to be mapped with SignalMapper
    void onButtonClicked(int i);
    void onTimeout(int i);

private:
    // Maps containing buttoons colors, if figure is solved and timers
    QPushButton ***map;
    QColor ** color_map;
    bool ** bool_map;
    QTimer *** timer_map;

    // Game data: size of game
    int n_rows;
    int n_cols;

    // Last coords clicked
    int last_r;
    int last_c;
};

#endif // MemoryGame_H
